# 自动取款
# 定义一个用于存放钱的变量
rmblist = [{'name':'supreme','rmb':10000}]

# 定义一个显示账户函数
def showrmb(rmblist):
	print("|{0:<5}|{1}|".format("name","rmb"))
	print('-'*30)
	print("|{0:<5}|{1}|".format(rmblist[0]["name"],rmblist[0]["rmb"]))


while True:
	# 输出一个初始化界面
	print('='*12,"中国人民银行",'='*14)
	print("{0:1}{1:13}{2:>15}".format(" ","1.登录","2.退出"))
	print('='*40)

	key = input("请输入对应的选项：")

	if key == "1":
		while True:
			# 输出初始界面
			print("="*12,"中国人民银行","="*14)
			print("{0:1}{1:13}{2:15}".format(" ","1.查询余额","2.取钱"))
			print("{0:1}{1:13}{2:15}".format(" ","3.存钱","4.退出系统"))
			print("="*40)

			key = input("请输入对应的选项：")

			# 根据键盘，判断并执行对应的操作
			if key == "1":
				print("="*12,"查询余额","="*14)
				showrmb(rmblist)
				input("按回车键继续：")

			elif key == "2":
				print("="*12,"取钱","="*14)
				showrmb(rmblist)
				a = input("请输入要取的金额：")
				# 获取银行里的钱并减去取款额
				b = int(rmblist[0]['rmb'])-int(a)
				rmblist[0]['rmb'] = b
				showrmb(rmblist)
				input("按回车键继续：")

			elif key == "3":
				print("="*12,"存钱","="*14)
				showrmb(rmblist)
				a = input("请输入要存的金额：")
				# 获取银行里的钱并加上存款额
				b = int(rmblist[0]['rmb'])+int(a)
				rmblist[0]['rmb'] = b
				showrmb(rmblist)
				input("按回车键继续：")

			elif key == "4":
				print("="*15,"再见","="*15)
				break

			else:
				print("="*14,"无效输入","="*14)

	elif key == "2":
		print("="*12,"退出登录系统","="*14)
		break

	else:
		print("="*12,"请输入有效数据","="*14)